package de.duplicatedetector.directoryhandler;

import java.io.File;
import java.util.ArrayList;

public class DirectoryHandler {

	private ArrayList<File> files;
	
	
	public DirectoryHandler() {
		files = new ArrayList<File>();
	}
	
	public void startDirectoryCrawler(File current) {
		File[] list = current.listFiles();
		if(list.length == 0) {
			files.add(current);
			return;
		} else {
			for(File file : list) {
				if(file.isDirectory()) {
					startDirectoryCrawler(file);
				} else {
					files.add(file);
				}
			}
		}
	}
	
	public ArrayList<File> getFileList() {
		return files;
	}
	
}
